Database live reindex

ABSTRACT

A computer-implemented method comprises receiving, by a processor, search requests to search a database; receiving a reindex request to reindex information in the database based on a new ontology for the database or a new number of shards for a first index server; initiating, by the processor, generation of a second index for the database while a first index managed by the first index server continues to be used live for responding to received search requests; completing the generation of the second index during a certain period when no search request is sent to the first index server; and in response to the completing, using the second index live for responding to received search requests.

BENEFIT CLAIM

This application claims the benefit 35 U.S.C. § 120 as a continuation ofapplication Ser. No. 16/557,583, filed Aug. 30, 2019, which is acontinuation of application Ser. No. 14/837,951, filed Aug. 27, 2015,now U.S. Pat. No. 10,402,385, issued on Sep. 3, 2019, the entirecontents of which are hereby incorporated by reference for all purposesas if fully set forth herein. The applicants hereby rescind anydisclaimer of claim scope in the priority applications or theprosecution history thereof and advise the USPTO that the claims in thisapplication may be broader than any claim in the priority applications.

TECHNICAL FIELD

Some embodiments of the present invention relate generally to datamodeling using computer systems, and more particularly, to a methodologyfor reindexing a database in a live environment.

BACKGROUND

The approaches described in this section could be pursued, but are notnecessarily approaches that have been previously conceived or pursued.Therefore, unless otherwise indicated herein, the approaches describedin this section are not prior art to the claims in this application andare not admitted to be prior art by inclusion in this section.

Computers are powerful tools for accessing and storing vast amounts ofinformation. Computer databases are a common mechanism for storinginformation on computer systems. Databases can take many differentforms. One typical database is a collection of tables having rows andcolumns of information. For example, a database table of employees mayhave a row for each employee, and the columns designating specificsabout the employee, such as the employee's name, address, salary, etc.

One important aspect of databases is the speed at which they are able toretrieve information. The faster a given database is able to perform asearch or retrieve requested information, the better user experience auser of the database will have. One way to improve the speed of adatabase is to create an index. Generally, an index is a data structurethat improves the speed of retrieving data from the database at the costof additional storage space. Improved methods relating to indexes mayresult in better searches, and are always needed.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 shows a block diagram of a system in accordance with anembodiment of the invention.

FIG. 2 shows a flowchart of a method in accordance with an embodiment ofthe invention.

FIGS. 3A and 3B show an example in accordance with an embodiment of theinvention.

FIG. 4 shows a block diagram of a computer system upon which anembodiment of the invention may be implemented.

DESCRIPTION OF EXAMPLE EMBODIMENTS

In the following description, for the purposes of explanation, numerousspecific details are set forth in order to provide a thoroughunderstanding of the present invention. It will be apparent, however,that the present invention may be practiced without these specificdetails. In other instances, well-known structures and devices are shownin block diagram form in order to avoid unnecessarily obscuring thepresent invention.

OVERVIEW

Techniques are provided for reindexing a database in a live environment.Specifically, in one embodiment, a dispatch server receives a request toreindex a database. At the time the request to reindex is received, thedispatch server is configured to send queries for information in thedatabase to a first index server, the first index server comprising afirst index of information in the database. In response to receiving therequest to reindex and while the database is live, a second index of theinformation in the database is generated. The second index is stored ata second index server. The dispatch server is then configured to use thesecond index server as a live index server and to no longer use thefirst index server as a live index server.

Example System Implementation

FIG. 1 illustrates an example computer system 100 in which thetechniques described may be practiced, according to some embodiments.System 100 is a computer-based system. The various components of system100 are implemented at least partially by hardware at one or morecomputing devices, such as one or more hardware processors executingstored program instructions stored in one or more memories forperforming the functions that are described herein. In other words, allfunctions described herein are intended to indicate operations that areperformed using programming in a special-purpose computer orgeneral-purpose computer, in various embodiments. System 100 illustratesonly one of many possible arrangements of components configured toexecute the programming described herein. Other arrangements may includefewer or different components, and the division of work between thecomponents may vary depending on the arrangement.

System 100 includes dispatch server 105, server application 110,database 115, client device 120, index server1 125, index server 1A 130,index server2 135, and index server 2A 140. Dispatch server 105 may beany kind of computing device including, but not limited to: servers,racks, work stations, personal computers, general purpose computers,laptops, Internet appliances, hand-held devices, wireless devices, wireddevices, portable or mobile devices, wearable computers, cellular ormobile phones, portable digital assistants (PDAs), smart phones,tablets, multi-processor systems, microprocessor-based or programmableconsumer electronics, game consoles, set-top boxes, network PCs,mini-computers, and the like. Dispatch server 105 is communicativelyconnected, using wired and/or wireless connections, to database 115,client device 120, index server1 125, index server 1A 130, index server2135, and index server 2A 140. Although a single dispatch server 105 isshown in FIG. 1, any number of dispatch servers 105 may be used.Additionally, one or more load balancers (not shown) may be used whenthere are multiple dispatch servers in use. In one embodiment, dispatchserver 105 may execute any number of software applications, such asserver application 110.

In one embodiment, server application 110 includes programming to accessdatabase 115, handle requests, generate indexes, and/or other actionsrelated to database 115. Server application 110 may access database 115in any suitable manner, such as using a database connector. Serverapplication 110 includes programming to send requests to search and/orindex servers, such as index server1 125 and/or index server2 135. Therequests may be search requests from client devices for information thatis locatable using the index server(s). The requests may be transparentto any client devices. In other words, the client device is not aware ofwhere or how server application 110 obtains the answer to a request orquery.

In one embodiment, server application 110 includes programming toreindex a live database by generating a new index. Server application110 may receive a request to reindex a live database in any suitablemanner. Once received, server application 110 queries the database andgenerates a new index. Preferably, because the database is live, the newindex is generated slowly, to minimize any impact on databaseperformance. For example, the request to generate a new index mayspecify a batch size and thread count. The batch size defines the sizeof blocks of data to be retrieved from the database, while the threadcount refers to a number of processors or cores assigned to the process.Continuing the example, a batch size of 1000 and a thread count of 4 maynot impact a database in a noticeable way, but will still allow a newindex to be generated over time. Optionally, server application 110 maydetermine the batch size and/or thread count based on any suitablefactors, such as available server and/or database capacity. Further,server application 110 may dynamically vary the batch size and/or threadcount. Thus, for example, the batch size and thread count may increaseat night, when fewer users are requesting information from the database.Regardless of the batch size and/or thread count, server application 110iterates through all of the information in database 115. However,because the database is live, a complete iteration may not be possibleuntil dispatch server is quiesced, as discussed below.

In one embodiment, server application 110 includes programming to savethe newly generated index at a “shadow” index server. A shadow indexserver is not a live server. In other words, no search requests are sentto a shadow index server. Index servers, both live and shadow, arediscussed in more detail below. Server application 110 may save a newlygenerated index as the new index is generated by one or more threadsprocessing the information in the database that is being reindexed.Server application 110 may store the new index in any suitable manner orformat. For example, rather than storing the new index in memory, andthereby occupying a potentially large amount of server capacity, serverapplication 110 may store the new index in a commit log. Then, when thenew index is ready for use, a server may read the commit log andgenerate an in memory representation of the new index based on thecontent of the commit log.

In one embodiment, server application 110 includes programming toquiesce, or pause, the dispatch server 105. While the dispatch server isquiesced, no information will be added to database 115, and serverapplication 110 is able to complete the generation of a new index, suchas by completing iteration though the information in database 115. Oncethe generation of a new index is completed, server application 110reconfigures dispatch server 105 to send future search requests to thenew index, thereby replacing the “old” live index server with a newindex server (i.e., the shadow index server) featuring the newlygenerated index. Once reconfigured, server application 110 returnsdispatch server 105 to a live state, and all new search requests willsubsequently be directed to a live index server with the newly generatedindex.

In one embodiment, database 115 is any suitable storage device such asone or more hard disk drives, memories, or any other electronic digitaldata recording device configured to store data. Although database 115 isdepicted as a single device in FIG. 1, database 115 may span multipledevices located in one or more physical locations. Additionally, in oneembodiment, database 115 may be located on the same device(s) asdispatch server 105. Alternatively, database 115 may be located on aseparate device(s) from dispatch server 105, or any other suitablecomponent. Database 115 may store any type of information in any format.In one embodiment, database 115 is a “key-value” database. The term“key-value” is not meant to imply any particular database or databasesystem, or imply any particular type of database or database system.Rather, “key-value” refers broadly to the general manner in whichdatabase 115 is presented to other components of FIG. 1. Morespecifically, a database management system may present a key-valueabstraction of the underlying information of database 115 to othercomponents of FIG. 1 through an Application Programming Interface (API).In one embodiment, database 115 uses a chronologically increasing dataevent ID number for each piece(s) of data added to the database, therebyallowing for easy iteration through the database by accessing each dataevent ID.

In one embodiment, database 115 is managed by a database managementsystem (not shown). The database management system may be implemented byany one of a variety of different database management systems andembodiments of the invention are not limited to any particular databasemanagement system. For example, the database management system may beimplemented by a conventional relational database management system(RDBMS). Alternatively, as another example, the database managementsystem may be implemented using a “NoSQL” database management system orother database management system that differs from a traditional RDBMSin one or more respects. In one particular non-limiting embodiment, thedatabase management system is implemented using a version of the ApacheHBase database management system. In one embodiment, database 115 may beembodied as a collection of one or more file system files. For example,database 115 may be embodied as a collection of one or more files of anoperating system. Alternatively, database 115 may be a file systemitself. For example, database 115 may be a distributed file system suchas, for example, the Apache Hadoop Distributed File System (HDFS).

In one embodiment, database 115 organizes data in a structure that isdescribed using an ontology, embodied in a database schema, comprising adata model that is used to represent the structure and reason aboutobjects in the structure. The ontology may define one or more objecttypes, and each object type may have one or more properties. Optionally,the ontology is able to be changed by a user or administrator, and maybe a reason for reindexing.

In one embodiment, client device 120 may be any kind of computing deviceincluding, but not limited to: work stations, personal computers,general purpose computers, laptops, Internet appliances, hand-helddevices, wireless devices, wired devices, portable or mobile devices,wearable computers, cellular or mobile phones, portable digitalassistants (PDAs), smart phones, tablets, multi-processor systems,microprocessor-based or programmable consumer electronics, gameconsoles, set-top boxes, network PCs, mini-computers, and the like.Although a single client device 120 is shown in FIG. 1, any number ofclient devices may be present. Client device 120 is communicativelyconnected to dispatch server 105. Client device 120 may execute one ormore software applications (not shown). The software applications may begeneral purpose applications, such as a web browser, spreadsheetapplication, or a customized application, such as an application forretrieving and analyzing data from a database. The software applicationsmay be thin client or thick client. The software applications may sendrequests to dispatch server 105 in any manner and/or in any format nowknown or later developed. Specifically, the requests may include, butare not limited to: search requests, reindexing requests, aggregationrequests, requests to store or edit information in database 115, etc.

In one embodiment, the index servers (e.g., index server1 125, indexserver 1A 130, index server 2, 135, and index server 2A 140) may be anycomputing and/or storage device(s) including, but not limited to:servers, racks, work stations, personal computers, general purposecomputers, laptops, Internet appliances, hand-held devices, wirelessdevices, wired devices, portable or mobile devices, wearable computers,cellular or mobile phones, portable digital assistants (PDAs), smartphones, tablets, multi-processor systems, microprocessor-based orprogrammable consumer electronics, game consoles, set-top boxes, networkPCs, mini-computers, and the like. The index servers (e.g., indexserver1 125, index server 1A 130, index server 2, 135, and index server2A 140) may be located on one or more separate devices, on a singledevice, or some combination thereof.

In one embodiment, index server1 125 and index server2 135 are liveindex servers that include programming to respond to search requestsfrom dispatch server 105. Index server1 125 and index server2 135 may beany type of indexes. Specifically, index server1 125 and index server2135 may each by a different type of index, with different strengths andweaknesses. For example, index server1 125 may be a search server thatis optimized for searching text whether the text is structured orunstructured, such as full text searches. Specifically, index server1125 may be an inverted index. Continuing the example, index server2 135may be a horizon server optimized for searching objects, locations,and/or other types of information. Specifically, index server2 135 maybe an in-memory column store. However, index server1 125 and indexserver2 135 may each be any type of index optimized for any type ofsearch. In one embodiment, index server1 125 and index server2 135 maybe different shards of the same index, and therefore may be optimizedfor the same type of searches.

As indicated by the dotted lines, index server1 A 130 and index server2A 140 are secondary, or “shadow,” index servers that do not receivelive search requests from dispatch server 105. Rather, index server 1A130 and index server 2A 140 include a second, or new, index of theircorresponding “live” index server. The second, or new, index may bepartial or otherwise is in the process of being created. Once the secondindex is completed, index server 1A 130 and/or index server 2A 140 maybe switched from a “shadow” state to a “live” state (such as by dispatchserver 105 directing searches to index server 1A 130 and/or index server2A 140, etc.), effectively replacing the corresponding live indexservers (i.e., index server1 125 and index server2 135, respectively),and begin to respond to search requests from dispatch server 105 usingthe new index. Alternatively, rather than reconfiguring the shadow indexservers to be live index servers, the newly generated index may becopied over to the live index server, and replace the “old” index,thereby removing the need to send subsequent requests to a differentserver.

Example Functional Implementation

FIG. 2 shows an example flowchart of a method for reindexing a databasein a live environment. Although the steps in FIG. 2 are shown in anorder, the steps of FIG. 2 may be performed in any order, and are notlimited to the order shown in FIG. 2. Additionally, some steps may beoptional, may be performed multiple times, and/or may be performed bydifferent components. All steps, operations and functions of a flowdiagram that are described herein are intended to indicate operationsthat are performed using programming in a special-purpose computer orgeneral-purpose computer, in various embodiments. In other words, eachflow diagram in this disclosure is a guide, plan or specification of analgorithm for programming a computer to execute the functions that aredescribed.

In step 205, a request to reindex a database is received. The requestmay be received in any suitable manner and/or format. Specifically, therequest is received from an administrator or other user of the database,and may contain specific instructions, such as a specified batch sizeand/or thread count to use when generating the new index. Alternatively,the request may be received from another process or other suitablesource, and/or may not contain a specified batch size and/or threadcount. In one embodiment, the request may be the result of defining anew ontology for the database, changing the number of shards in an indexserver, or any other suitable reason. In the event that the reindexrequest is based on a new ontology, the new ontology may be included inthe request.

In step 210, a second index for the database is generated. Specifically,the second index for the database is generated while the database islive and servicing real requests from client devices. The second indexmay be generated, for example, by iterating through the informationstored in the database, and processing the data to generate the secondindex. The second index, while containing the same or highly similarinformation to the “original” index, may be organized or structured in adifferent manner, such as by using a new ontology, or distributing thestored information across a different number of shards.

In step 215, the second index is stored at a second index server. Thesecond index may be stored in any suitable manner. In one embodiment,the second index is stored in a commit log, to minimize use of serverresources. Then, when the second index is completed, the second indexserver can use the commit log to generate an in memory representation ofthe second index. Alternatively, the second index may initially bestored in memory, or in any other suitable location, instead of in acommit log. While the second index is being stored at the second indexserver, the second index server is not live. In other words, the secondindex server will not and does not receive live search requests until,for example, step 235.

In step 220, the dispatch server is quiesced. The dispatch server may bequiesced, or paused, in any suitable manner. For example, the dispatchserver may store any received requests in a buffer for later response,or may simply ignore all requests received while quiesced. By quiescingthe dispatch server, the database will be able to maintain a steadystate, allowing the generation of the second index to complete.

In step 225, generation of the second index is completed. The generationmay be completed in any suitable manner. For example, the generation ofthe second index may be completed by finishing iterating through all ofthe information in the database, and subsequently storing the nowcompleted second index at the second index server.

In step 230, the dispatch server is configured to use the second indexserver as a live index server. In response to the completion of thesecond index, or at any other time after the completion of the secondindex, the dispatch server is reconfigured to use the second indexserver as the live index server. In other words, search requests willnow be sent to the second index server, and responded to using the newsecond index, instead of the first “original” index server.Alternatively, rather than reconfigure the dispatch server to use thesecond index server as a live index server, the newly generated secondindex may instead be copied over to the “original” index server, wherethe second index will replace the “original” index. Thus, the “original”index server will be updated with the second index, and reconfiguringthe dispatch server to send requests to the second index server would beunnecessary.

In step 235, the dispatch server is returned to a live state. Thedispatch server may be returned to a live state in any suitable manner.Once returned to a live state, the dispatch server will begin sendingsearch requests to the second index server, which will return resultsbased on the second index. Alternatively, as discussed in step 230, thedispatch server may still send search requests to the “original” indexserver in the embodiment where the second index is copied over to the“original” index server.

Example Use Case

FIGS. 3A and 3B show an example use case of reindexing a database in alive environment. The example shown in FIGS. 3A and 3B has beensimplified, to ease understanding and, as such, the example should notbe construed to limit the disclosure to the specifics discussed below.

In FIG. 3A, an example system is shown, consisting of dispatch server300, database 305, live index server 310, and new index server 315.Dispatch server 300 is a server responsible for handling requests fromclients and generating a new index of database 305. Database 305 is adatabase for storing information which is indexed at live index sever310. Live index server 310 is an index that is sent and responds tosearch requests from dispatch server 300. As indicated by the dottedlines, new index server 315 is a shadow index server that is not live.Rather, new index server 315 is used for storing a new index of database305 as the new index is generated, and once the new index is completed,new index server 315 will be used as a live index server.

In FIG. 3A, dispatch server 300 has received a request to reindexdatabase 305, and has begun reindex process 320 in response. Reindexprocess 320 proceeds to generate a new index with a limited batch sizeand thread count so that the performance of database 305 is not affectedby the reindexing process. During the reindexing processes,communications comprising reindexing data 325 are exchanged betweendatabase 305 and dispatch server 300, and are then processed.Specifically, the reindex process 320 involves, in part, iteratingthrough all of the information in database 305. As the reindex process320 generates new index data 330, new index data 330 is sent to newindex server 315 for storage. Simultaneously, job A 335 is received bydispatch server 300. In response, dispatch server 300 sends a searchrequest with job A data 340 to live index server 310, which uses thecurrent index to respond to the search request, and return a response.Thus, job A 335 is serviced using, at least in part, live index server310 while a new index for database 305 is generated.

Eventually, reindex process 320 determines that for the generation ofthe new index to complete, dispatch server 300 needs to be quiesced. Inresponse, reindex process 320 quiesces dispatch server 300, therebytemporarily halting any changes to database 305, and allowing thereindex process to complete. Subsequently, once the completed new indexhas been stored on new index server 315, reindex process, or anadministrator or other user, reconfigures dispatch server 300 to use newindex server 315 as the live index server. After the reconfiguration,the dispatch server 300 is returned to a live state, and the examplecontinues in FIG. 3B.

FIG. 3B shows the same system as in FIG. 3A, but after the new index hasbeen generated and dispatch server 300 has been reconfigured to use newindex server 315 as a live index server. This is indicated in FIG. 3Bthrough the now-dotted lines used to depict live index server 310 (incontrast to the solid lines of FIG. 3A), and the now-solid lines used todepict new index server 315 (in contrast to the dotted lines of FIG.3A). Thus, when dispatch server receives job B 345, dispatch server 300sends a search request with job B data 350 to new index server 315,which uses the new index to respond to the search request, and return aresponse. Thus, job B 345 is serviced using, at least in part, new indexserver 315. As live index server 310 is no longer in use, live indexserver 310 may be brought offline and/or used for another purpose.

Hardware Overview

According to one embodiment, the techniques described herein areimplemented by one or more special-purpose computing devices. Thespecial-purpose computing devices may be hard-wired to perform thetechniques, or may include digital electronic devices such as one ormore application-specific integrated circuits (ASICs) or fieldprogrammable gate arrays (FPGAs) that are persistently programmed toperform the techniques, or may include one or more general purposehardware processors programmed to perform the techniques pursuant toprogram instructions in firmware, memory, other storage, or acombination. Such special-purpose computing devices may also combinecustom hard-wired logic, ASICs, or FPGAs with custom programming toaccomplish the techniques. The special-purpose computing devices may bedesktop computer systems, portable computer systems, handheld devices,networking devices or any other device that incorporates hard-wiredand/or program logic to implement the techniques.

For example, FIG. 4 is a block diagram that illustrates a computersystem 400 upon which an embodiment of the invention may be implemented.Computer system 400 includes a bus 402 or other communication mechanismfor communicating information, and a hardware processor 404 coupled withbus 402 for processing information. Hardware processor 404 may be, forexample, a general purpose microprocessor.

Computer system 400 also includes a main memory 406, such as a randomaccess memory (RAM) or other dynamic storage device, coupled to bus 402for storing information and instructions to be executed by processor404. Main memory 406 also may be used for storing temporary variables orother intermediate information during execution of instructions to beexecuted by processor 404. Such instructions, when stored innon-transitory storage media accessible to processor 404, rendercomputer system 400 into a special-purpose machine that is customized toperform the operations specified in the instructions.

Computer system 400 further includes a read only memory (ROM) 408 orother static storage device coupled to bus 402 for storing staticinformation and instructions for processor 404. A storage device 410,such as a magnetic disk or optical disk, is provided and coupled to bus402 for storing information and instructions.

Computer system 400 may be coupled via bus 402 to a display 412, such asa cathode ray tube (CRT), for displaying information to a computer user.An input device 414, including alphanumeric and other keys, is coupledto bus 402 for communicating information and command selections toprocessor 404. Another type of user input device is cursor control 416,such as a mouse, a trackball, or cursor direction keys for communicatingdirection information and command selections to processor 404 and forcontrolling cursor movement on display 412. This input device typicallyhas two degrees of freedom in two axes, a first axis (e.g., x) and asecond axis (e.g., y), that allows the device to specify positions in aplane.

Computer system 400 may implement the techniques described herein usingcustomized hard-wired logic, one or more ASICs or FPGAs, firmware and/orprogram logic which in combination with the computer system causes orprograms computer system 400 to be a special-purpose machine. Accordingto one embodiment, the techniques herein are performed by computersystem 400 in response to processor 404 executing one or more sequencesof one or more instructions contained in main memory 406. Suchinstructions may be read into main memory 406 from another storagemedium, such as storage device 410. Execution of the sequences ofinstructions contained in main memory 406 causes processor 404 toperform the process steps described herein. In alternative embodiments,hard-wired circuitry may be used in place of or in combination withsoftware instructions.

The term “storage media” as used herein refers to any non-transitorymedia that store data and/or instructions that cause a machine tooperation in a specific fashion. Such storage media may comprisenon-volatile media and/or volatile media. Non-volatile media includes,for example, optical or magnetic disks, such as storage device 410.Volatile media includes dynamic memory, such as main memory 406. Commonforms of storage media include, for example, a floppy disk, a flexibledisk, hard disk, solid state drive, magnetic tape, or any other magneticdata storage medium, a CD-ROM, any other optical data storage medium,any physical medium with patterns of holes, a RAM, a PROM, and EPROM, aFLASH-EPROM, NVRAM, any other memory chip or cartridge.

Storage media is distinct from but may be used in conjunction withtransmission media. Transmission media participates in transferringinformation between storage media. For example, transmission mediaincludes coaxial cables, copper wire and fiber optics, including thewires that comprise bus 402. Transmission media can also take the formof acoustic or light waves, such as those generated during radio-waveand infra-red data communications.

Various forms of media may be involved in carrying one or more sequencesof one or more instructions to processor 404 for execution. For example,the instructions may initially be carried on a magnetic disk or solidstate drive of a remote computer. The remote computer can load theinstructions into its dynamic memory and send the instructions over atelephone line using a modem. A modem local to computer system 400 canreceive the data on the telephone line and use an infra-red transmitterto convert the data to an infra-red signal. An infra-red detector canreceive the data carried in the infra-red signal and appropriatecircuitry can place the data on bus 402. Bus 402 carries the data tomain memory 406, from which processor 404 retrieves and executes theinstructions. The instructions received by main memory 406 mayoptionally be stored on storage device 410 either before or afterexecution by processor 404.

Computer system 400 also includes a communication interface 418 coupledto bus 402. Communication interface 418 provides a two-way datacommunication coupling to a network link 420 that is connected to alocal network 422. For example, communication interface 418 may be anintegrated services digital network (ISDN) card, cable modem, satellitemodem, or a modem to provide a data communication connection to acorresponding type of telephone line. As another example, communicationinterface 418 may be a local area network (LAN) card to provide a datacommunication connection to a compatible LAN. Wireless links may also beimplemented. In any such implementation, communication interface 418sends and receives electrical, electromagnetic or optical signals thatcarry digital data streams representing various types of information.

Network link 420 typically provides data communication through one ormore networks to other data devices. For example, network link 420 mayprovide a connection through local network 422 to a host computer 424 orto data equipment operated by an Internet Service Provider (ISP) 426.ISP 426 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the“Internet” 428. Local network 422 and Internet 428 both use electrical,electromagnetic or optical signals that carry digital data streams. Thesignals through the various networks and the signals on network link 420and through communication interface 418, which carry the digital data toand from computer system 400, are example forms of transmission media.

Computer system 400 can send messages and receive data, includingprogram code, through the network(s), network link 420 and communicationinterface 418. In the Internet example, a server 430 might transmit arequested code for an application program through Internet 428, ISP 426,local network 422 and communication interface 418.

The received code may be executed by processor 404 as it is received,and/or stored in storage device 410, or other non-volatile storage forlater execution.

Extensions and Alternatives

In the foregoing specification, embodiments of the invention have beendescribed with reference to numerous specific details that may vary fromimplementation to implementation. The specification and drawings are,accordingly, to be regarded in an illustrative rather than a restrictivesense. The sole and exclusive indicator of the scope of the invention,and what is intended by the applicants to be the scope of the invention,is the literal and equivalent scope of the set of claims that issue fromthis application, in the specific form in which such claims issue,including any subsequent correction.

What is claimed is:
 1. A computer-implemented method comprising:receiving, by a processor, search requests to search a database;receiving a reindex request to reindex information in the database basedon a new ontology for the database or a new number of shards for a firstindex server; initiating, by the processor, generation of a second indexfor the database while a first index managed by the first index servercontinues to be used live for responding to received search requests;completing the generation of the second index during a certain periodwhen no search request is sent to the first index server; in response tothe completing, using the second index live for responding to receivedsearch requests.
 2. The computer-implemented method of claim 1, thereindex request specifying a batch size defining a size of blocks ofdata to be retrieved from the database during reindexing, the reindexrequest specifying a thread count defining a number of processors orcores assigned to the reindexing.
 3. The computer-implemented method ofclaim 2, further comprising dynamically varying the batch size or thethread count during the reindexing based on server or database capacity.4. The computer-implemented method of claim 2, further comprisingdetermining a first value that limits the batch size or a second valuethat limits the thread count based on performance metrics of thedatabase.
 5. The computer-implemented method of claim 1, furthercomprising: storing the second index at a second index server; sendingreceived search requests to the first index server when the first indexis used live and sending received search requests to the second indexserver when the second index is used live.
 6. The computer-implementedmethod of claim 1, further comprising: storing the second index in acommit log; before using the second index live, generating in memoryrepresentation of the second index from reading the commit log.
 7. Thecomputer-implemented method of claim 1, further comprising storingreceived search requests in a buffer during the certain period.
 8. Thecomputer-implemented method of claim 1, further comprising ignoringreceived search requests during the certain period.
 9. Thecomputer-implemented method of claim 1, further comprising copying thesecond index to the first index server.
 10. The computer-implementedmethod of claim 1, the database assigning a chronologically increasingdata event ID number to each piece of data added to the database, thecompleting comprising processing pieces of data assigned data event IDnumbers higher than data event ID numbers assigned to pieces of dataprocessed during the initiating.
 11. One or more non-transitorycomputer-readable storage media storing instructions which when executedcause one or more processors to perform a method, the method comprising:receiving search requests to search a database; receiving a reindexrequest to reindex information in the database based on a new ontologyfor the database or a new number of shards for a first index server;initiating generation of a second index for the database while a firstindex managed by the first index server continues to be used live forresponding to received search requests; completing the generation of thesecond index during a certain period when no search request is sent tothe first index server; in response to the completing, using the secondindex live for responding to received search requests.
 12. The one ormore non-transitory computer-readable storage media of claim 11, thereindex request specifying a batch size defining a size of blocks ofdata to be retrieved from the database during reindexing, the reindexrequest specifying a thread count defining a number of processors orcores assigned to the reindexing.
 13. The one or more non-transitorycomputer-readable storage media of claim 12, the method furthercomprising dynamically varying the batch size or the thread count duringthe reindexing based on server or database capacity.
 14. The one or morenon-transitory computer-readable storage media of claim 12, the methodfurther comprising determining a first value that limits the batch sizeor a second value that limits the thread count based on performancemetrics of the database.
 15. The one or more non-transitorycomputer-readable storage media of claim 11, the method furthercomprising: storing the second index at a second index server; sendingreceived search requests to the first index server when the first indexis used live and sending received search requests to the second indexserver when the second index is used live.
 16. The one or morenon-transitory computer-readable storage media of claim 1, the methodfurther comprising: storing the second index in a commit log; beforeusing the second index live, generating in memory representation of thesecond index from reading the commit log.
 17. The one or morenon-transitory computer-readable storage media of claim 11, the methodfurther comprising storing received search requests in a buffer duringthe certain period.
 18. The one or more non-transitory computer-readablestorage media of claim 11, the method further comprising ignoringreceived search requests during the certain period.
 19. The one or morenon-transitory computer-readable storage media of claim 11, the methodfurther comprising copying the second index to the first index server.20. The one or more non-transitory computer-readable storage media ofclaim 11, the database assigning a chronologically increasing data eventID number for each piece of data added to the database, the completingcomprising processing pieces of data assigned data event ID numbershigher than data event ID numbers assigned to pieces of data processedduring the initiating.